<?php
require_once 'z.php';

$jobs = array(
    'active_loans'         => 'Emms_Cron_ActiveLoans',
    'arrears'              => 'Emms_Cron_Arrears',
    'loan_write_offs'      => 'Emms_Cron_LoanWriteOffs',
    'donation_allocations' => 'Emms_Cron_DonationAllocations',
    'exchange_rates'       => 'Emms_Cron_ExchangeRates',
    'performance_data'     => 'Emms_Cron_PerformanceData',
    'messages'             => 'Emms_Cron_Messages'
);

$cron = new Emms_Cron();

foreach($jobs as $tbl => $model) {
    $cron->setMode('Maintenance',$tbl);
    try {
        $job = new $model();
        $job->update();
    } catch (Exception $e) {
        $cron->setMode('Maintenance',$tbl,$e->getMessage());
        exit;
    }
    unset($job);
    $cron->setMode('Maintenance',$tbl,'Done');
}

$cron->setMode('Normal','','');

?>



